package com.emmy.walnut.view;

import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;

import com.emmy.walnut.R;

/**
 *
 */
public class SwitchModeActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_switch_mode);

        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                back(null);
            }
        }, 500);
    }

    @Override
    public void onBackPressed() {
        back(null);
    }

    private void back(View view){
        finish();
        overridePendingTransition(R.anim.switch_activity_anim_in,
                R.anim.switch_activity_anim_out);
    }
}
